package test {
	import com.xskip.display.StageLink;
	import sandy.util.DistortImage;

	import org.aswing.utils.HashMap;

	import flash.display.Bitmap;
	import flash.display.Sprite;	

	/**
	 * @author JamesXie
	 * @version 1.0
	 * @date Jan 21, 2011
	 * @name TestBianXing 测试变形类
	 */
	public class TestImageBomb extends Sprite {
		private var _hmImage : HashMap;

		public function TestImageBomb() : void {
			init();
			run();
		}

		private function init() : void {
		}

		private function run() : void {
			var fHashMap : HashMap = new HashMap();
			fHashMap.put("key00", "asset/other/pixel_house.png");
			
			var fTestLoadList : TestLoadList; 
			fTestLoadList = new TestLoadList(fHashMap, loadCompleteHandler);
		}

		private function loadCompleteHandler(pHashMap : HashMap) : void {
			trace("[DEBUG] [TestBianXing] loadCompleteHandler");
			trace("pHashMap " + pHashMap);
			_hmImage = pHashMap.clone();
			
			//testBianXing();
			
			//需要那个素材
			var fAssetStr:String = "key00";
			
			var fBitmap : Bitmap = _hmImage.getValue(fAssetStr);

			//全局移动
			var offsetX:Number = 200;
			var offsetY:Number = 50;
			
			fBitmap.x = offsetX;
			fBitmap.y = offsetY;
			
			StageLink.STAGE.addChild(fBitmap);
			
			trace(fBitmap.bitmapData.getPixel32(20, 20));
			trace(fBitmap.bitmapData.getPixel32(200, 200));
			trace("-----------------------------------");
			//Blue
			trace(fBitmap.bitmapData.getPixel32(200, 200) >> 0 & 0xFF);
			//Green
			trace(fBitmap.bitmapData.getPixel32(200, 200) >> 8 & 0xFF);
			//Red
			trace(fBitmap.bitmapData.getPixel32(200, 200) >> 16 & 0xFF);
			//Alpha
			trace(fBitmap.bitmapData.getPixel32(200, 200) >> 24 & 0xFF);
			
			//fBitmap.bitmapData.setPixel32(10, 10, 0xFF663300);
			//fBitmap.bitmapData.setPixel32(10, 10, 4285320133);
			
			fBitmap.bitmapData.setPixel32(200, 190, 0xFF000000);
			fBitmap.bitmapData.setPixel32(201, 191, 0x00FF0000);
			fBitmap.bitmapData.setPixel32(202, 192, 0x0000FF00);
			fBitmap.bitmapData.setPixel32(203, 193, 0xFFFFFF00);
			

		}
	}
}